package com.liu.cmsService.controller;

import com.liu.R;
import com.liu.cmsService.entity.CrmBanner;
import com.liu.cmsService.service.CrmBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * **************
 * 项目名称: testgulili <br/>
 * 文件名称:  <br/>
 * 文件描述: 前台的控制层。 <br/>
 * 文件创建：刘世锦 <br/>
 * 创建时间: 2022/1/17 <br/>
 *
 * @version v1.0 <br/>
 * @update [序号][日期YYYY-MM-DD][更改人姓名][变更描述]<br/>
 * *************
 */
@RestController
@RequestMapping("/cmsService/crmUserbanner")
@CrossOrigin
public class CrmBannerUserController {

    @Autowired
    private CrmBannerService crmBannerService;

    @Cacheable(key = "'getBannerList'",value = "banner")
    @GetMapping("getBannerList")
    public R getBannerList(){

        List<CrmBanner> list= crmBannerService.getBannerList();
        return R.ok().data("list",list);
    }


}
